package com.huiyou.item.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
import java.util.List;

/**
 * @author youjl
 * @date 2019/9/18
 */
@Table(name = "core_spu")
@Data
public class Spu {

    @Id
    @KeySql(useGeneratedKeys = true)
    private Long id;
    private String title;   //商品名称
    private String subTitle;  //子标题
    private Long cid1;   //一级类目
    private Long cid2;   //二级类目
    private Long cid3;   //三级类目
    private Long brandId;   //品牌id
    private Boolean saleable;  //是否上架
    private Boolean valid;  //是否有效,逻辑删除
    private Date createTime; //创建时间

    @JsonIgnore   //忽略返回
    private Date lastUpdateTime;

    //spu所属的分类名称
    @Transient   //变量将不再是对象持久化的一部分
    private String cname;
    //spu所属品牌名
    @Transient
    private String bname;
    //spu详情
    @Transient
    private SpuDetail spuDetail;
    //sku集合
    @Transient
    private List<Sku> skus;
}
